package com.ruoyi.cart.domain;


import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;

/**
 * 购物车对象 cart
 *
 * @author sqlstudent
 * @date 2025-06-12
 */
public class CartDetail extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 购物车id */
    private Long cartId;

    /** 用户id */
    @Excel(name = "用户名")
    private String userName;

    /** 产品id */
    @Excel(name = "产品名")
    private String productName;

    /** 数量 */
    @Excel(name = "数量")
    private Long quantity;

    @Excel(name = "总价")
    private String totalAmount;

    /** 添加时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "添加时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date addedDate;

    public void setCartId(Long cartId)
    {
        this.cartId = cartId;
    }

    public Long getCartId()
    {
        return cartId;
    }

    public String getTotalAmount() {
        return totalAmount;
    }

    public void setTotalAmount(String totalAmount) {
        this.totalAmount = totalAmount;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }
    public void setQuantity(Long quantity)
    {
        this.quantity = quantity;
    }

    public Long getQuantity()
    {
        return quantity;
    }

    public void setAddedDate(Date addedDate)
    {
        this.addedDate = addedDate;
    }

    public Date getAddedDate()
    {
        return addedDate;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
                .append("cartId", getCartId())
                .append("userName", getUserName())
                .append("productName", getProductName())
                .append("totalAmount", getTotalAmount())
                .append("quantity", getQuantity())
                .append("addedDate", getAddedDate())
                .toString();
    }
}
